﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace J.StatusRepository.Migrations
{
    public partial class liboyu3 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "BookingModel",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BookingTourists = table.Column<int>(type: "int", nullable: false),
                    BookingOrders = table.Column<int>(type: "int", nullable: false),
                    BookingName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    BookingPhone = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    BookingNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BookingBeginTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    BookingEndTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    TimeNumber = table.Column<int>(type: "int", nullable: false),
                    BookingText = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_BookingModel", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "BookingRoomModel",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BookingId = table.Column<int>(type: "int", nullable: false),
                    RoomTypeId = table.Column<int>(type: "int", nullable: false),
                    RoomNum = table.Column<int>(type: "int", nullable: false),
                    BreakfastNum = table.Column<int>(type: "int", nullable: false),
                    CustomizePrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    Townhouse = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_BookingRoomModel", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "OrdersModel",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RoomNum = table.Column<int>(type: "int", nullable: false),
                    RoomType = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    OrderState = table.Column<int>(type: "int", nullable: false),
                    BookingId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_OrdersModel", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "StayModel",
                columns: table => new
                {
                    ID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RoomType = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    RoomNum = table.Column<int>(type: "int", nullable: false),
                    Phone = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    RoomName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    DocumentsType = table.Column<int>(type: "int", nullable: false),
                    DocumentsNumber = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    OrdersId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_StayModel", x => x.ID);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "BookingModel");

            migrationBuilder.DropTable(
                name: "BookingRoomModel");

            migrationBuilder.DropTable(
                name: "OrdersModel");

            migrationBuilder.DropTable(
                name: "StayModel");
        }
    }
}
